-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth pairing cancellation error handling #122
Conversation
@@ -134,7 +134,7 @@ export default function DiscoverReadersScreen() { | |||
}, []); | |||
|
|||
const handleConnectReader = async (reader: Reader.Type) => { | |||
let error: StripeError; | |||
let error: StripeError | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to just OR it with null
? Also the syntax
let error?: StripeError | null;
will let it be undefined
or null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swapped it out but StripeError | undefined
is required by handleConnectBluetoothReader
and handleConnectInternetReader
so leaving as undefined
* connectingReader reset on error * locationId required for connectBluetoothReader * code style * onUnexpectedReaderDisconnect sends didFinishDiscoveringReaders event * DiscoverReaders failure triggers navigation.goBack * typecheck * replacing undefined with null * back to undefined
Addresses #109 and #49
DiscoverReadersScreen.connectingReader
gets reset on discovery errorlocationId
is required forconnectBluetoothReader
onUnexpectedReaderDisconnect
sendsdidFinishDiscoveringReaders
eventDiscoverReadersScreen
discovery failure triggersnavigation.goBack